﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Common;

namespace Indexing
{
    public abstract class IndexArguments
    {
        public Uri Uri;
        public RuleSet RuleSet;
        public DateTime MinDate;
		public int Depth;
        public string SiteName;

        public override string ToString()
        {
            return Uri.ToString();
        }
    }

    public class StoryIndexArguments : IndexArguments
    {

        public string HtmlPage = string.Empty;

        public StoryIndexArguments(string siteName, Uri uri, RuleSet ruleSet, DateTime minDate, int depth)
        {
            SiteName = siteName;
            Uri = uri;
            RuleSet = ruleSet;
            MinDate = minDate;
            Depth = depth;
        }

        public StoryIndexArguments(StoryIndexArguments storyIndexArguments)
        {
            Uri = new Uri(storyIndexArguments.Uri.ToString());
            RuleSet =  storyIndexArguments.RuleSet;
            MinDate = storyIndexArguments.MinDate;
            SiteName = storyIndexArguments.SiteName;
            Depth = storyIndexArguments.Depth;

        }
    }

    public class TalkbackIndexArguments : IndexArguments
    {
        public Talkback Talkback;

        public TalkbackIndexArguments(TalkbackIndexArguments talkbackArguments)
        {
            Uri = new Uri(talkbackArguments.Uri.ToString());
           RuleSet =  talkbackArguments.RuleSet;
            MinDate = talkbackArguments.MinDate;
            Talkback = new Talkback(talkbackArguments.Talkback); 
        }

        public TalkbackIndexArguments(Talkback talkback, Uri uri, RuleSet ruleSet, DateTime minDate)
        {
            Uri = uri;
            RuleSet = ruleSet;
            MinDate = minDate;
            Talkback = talkback;
            
        }

    }
}
